<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset={WIKI_CHARSET}"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1"/>
<title>{$navtitle} {$setting[site_name]} {$setting[seo_title]} - Powered by HDWiki!</title>
<link  rel="stylesheet" type="text/css" href="{WIKI_URL}/style/default/editor.css" media="all" />
<link href="{WIKI_URL}/js/jqeditor/skins/skin_base.css" rel="stylesheet" type="text/css" media="all" />
<!--[if IE]>
<script src="js/html5.js" type="text/javascript"></script>
<![endif]-->
<script type="text/javascript" src="./js/jquery.js"></script>
</head>
<body>
<header id="nav-top" class="wrap">
	<ul class="l">
		<li><a href="{WIKI_URL}" target="_blank">{lang index}</a></li>
		<!--{if getCount($channellist)!=0}-->
		<!--{loop $channellist $channel}-->
		<li><a href="{$channel['url']}" target="_blank">{$channel['name']}</a></li>
		<!--{/loop}-->
		<!--{/if}-->		
		<li><a href="{url category}" target="_blank">{lang wikiCategory}</a></li>
		<li><a href="{url list}" target="_blank">{lang list}</a></li>
		
	</ul>
	<ul class="r loginbar" id="top_usernav">
            <!--{if $user['groupid']=='1'}-->
            <li name="login"><a href="index.php?user-login">{lang login}</a></li>
            <li name="register" class="bor_no"><a href="index.php?user-register">{lang register}</a></li>
            <!--{else}-->
            <li class="hover-menu" title="{lang headerTip}"><a href="{url user-space-$user['uid']}">{$user['username']}</a>
                <!--{if $user['password']!=''}-->
                <p>
                    <a href="{url user-profile}">{lang selfManage}</a>
                    <!--{if $adminlogin }--><a href="index.php?admin_main">{lang sysConfig}</a>
                    <!--{/if}-->
                    <a href="index.php?user-logout{$referer}">{lang logout}</a>
                </p>
                <!--{/if}-->
            </li>
            <!--{if $user['password']!=''}-->
            <li><a href="{if $newpms[3]}
{url pms-box-inbox-system}
{else}
{url pms}
{/if}" id="header-pms" class="h-msg">
	{if $newpms[0]}
		<i>$newpms[0]</i>
	{/if}
	消息</a></li>
            <!--{else}-->
            <li><a href="index.php?user-login">{lang active}</a></li>
            <li class="bor_no"><a href="index.php?user-logout{$referer}">{lang logout}</a></li>
            <!--{/if}-->
            <!--{/if}-->
            <li class="bor_no help"><a href="index.php?doc-innerlink-{eval echo urlencode('{lang help}')}">{lang help}</a></li>
	</ul>
</header>

<form name="edit_doc" id="hdwiki_editor" class="jqeditor" method="post" enctype="multipart/form-data" action="<!--{if $page_action == 'create'}-->{url doc-create}<!--{elseif $page_action == 'edit'}-->{url doc-edit}<!--{else}-->{url doc-editsection}<!--{/if}-->" name='editor' onsubmit="return check();">
	<input type="hidden" name='did' id='did' value="{$doc['did']}" />
	<input type="hidden" name='section_id' value="{$doc['section_id']}" />
	<input type="hidden" name='create_submit' value="1" />
	<input type="hidden" name='title' id='title' value="{$doc['title']}" />
	<input type="hidden" name="category" value="{$doc['cid']}"/>
    <?php echo csrf_field(); ?>
    
<div class="instrument">
	<div style="height:36px;margin:2px 0;">
		<div class="jqe-toolbar"></div>
	</div>
</div>
<section class="wrap">
<div id="editoring" class="editor_left size">
<a href="{url doc-view-$doc['did']}" target="_blank">{$doc['title']}</a> &nbsp; <em>{lang editoring}</em>
</div>

<div id="summary" class="hd-box editor_left">
	<h2>{lang summary}</h2>
	<div>
	<!--	<textarea rows="3" class="size" name='summary'>{eval echo html_entity_decode($doc['summary']);}</textarea>-->
		<textarea rows="3" class="size" name='summary'>{$doc['summary']}</textarea>
	</div>
</div>
<div id="text" class="hd-box editor_left">
	<h2>{lang editTip5}</h2>
	<textarea id="content" name="content" style="width:98%;height:400px;visibility:hidden;display:none;">
	{$doc['content']}
	</textarea>
	<div class="jqe-content"></div>
</div>
<div id="tags" class="hd-box editor_left">
	<h2>{lang tag}</h2>
	<div>
	<input type="text" class="inp_txt" size="60" name='tags' value="{$doc['tag']}" /> <br /><span class="gray">[{lang editorTip8}]</span>
	</div>
</div>
	<script>
		$('input[name=tags]').blur(function(){
			var obj = $('input[name=tags]');
			var flag = check_access(obj);
			console.log(flag);
			if(!flag){
				alert('请输入正常格式的词条标签！');
				return false;
			}
		})
		function check_access(obj){
			var min_array = ['cast', 'exec','show ','show/*','alter ','alter/*','create ','create/*','insert ','insert/*', 'select ','select/*','delete ','delete/*','update ', 'update/*','drop ','drop/*','truncate ','truncate/*','replace ','replace/*','union ','union/*','execute', 'from', 'declare', 'varchar', 'script', 'iframe', ';', '0x', '<', '>', '\\', '%27', '%22', '(', ')'];
			var coun = min_array.length;
			var input_value = obj.val();
			for(var i = 0;i<coun;i++) {
				if (input_value.indexOf(min_array[i]) > -1) {
					obj.val('');
					return false;
				}
			}
			return true;
		}


	</script>
<!--{if $setting[base_isreferences] !== '0' }-->
<div id="reference" class="hd-box editor_left">
	<h2>{lang references}</h2>
	<dl class="f8" id="0" style="display:none;">
		<dt><strong name="order">[0]</strong><span></span></dt>
		<dd name="url"></dd>
		<dd name="edit">
			<a href="javascript:;" onclick="docReference.edit(this);return false;">{lang edit}</a> 
			| <a name="remove" href="javascript:;" onclick="docReference.remove(this);return false;">{lang remove}</a>
		</dd>
	</dl>
	<!--{loop $referencelist $i $ref}-->
	<dl class="f8" id="{$ref[id]}">
		<dt><strong name="order">[{eval echo ($i+1)}]</strong><span>{$ref[name]}</span></dt>
		<dd name="url">{$ref[url]}</dd>
		<dd name="edit">
			<a href="javascript:;" onclick="docReference.edit(this);return false;">{lang edit}</a> 
			| <a name="remove" href="javascript:;" onclick="docReference.remove(this);return false;">{lang remove}</a>
		</dd>
	</dl>
	<!--{/loop}-->
	
	<dl id="edit_reference" style="display:none">
		<dt class="mar-bottom-10"><strong>{lang name}:</strong>
			<input id="editrefrencename" type="text" class="inp_txt" size="60"/>
			<span class="red" id="refrencenamespan"></span>
		</dt>
		<dd class="size black mar-bottom-10"><strong>{lang url}:</strong>
			<input id="editrefrenceurl" type="text" class="inp_txt" size="60"/>
			<span class="red" id="refrenceurlspan"></span>
		</dd>
		
		<dd name="verifycode" class="size black mar-bottom-10" style="display:none"><strong>{lang verifyCode}:</strong>
			<input name="code" id="editrefrencecode" type="text" class="inp_txt" size="10" maxlength="4"/>
			<span name="img" style="display:none"><img id="verifycode2" src="./js/hdeditor/skins/spacer.gif"/> <a href="javascript:docReference.updateVerifyCode();">{lang codeNotClear}</a></span>
			<span name="tip"></span>
			<span class="red" id="refrencecodespan"></span>
		</dd>
		
		<dd>
			<a id="save_1" class="btn_inp blue" href="javascript:;" onclick="docReference.save();return false;">{lang save}</a>
			<span id="save_0" class="btn_inp disabled" style="display:none">{lang save}</span>
			<a href="javascript:;" class="btn_inp" onclick="docReference.reset();return false;">{lang reset}</a>
		</dd>
	</dl>
</div>
<!--{/if}-->
<!--{if $page_action != 'create'}-->
<div id="reason" class="hd-box editor_left">
	<h2>{lang reason}<span class="red">[{lang mustBeCompleted}]</span></h2>
	<div>
	<label><input type="checkbox" value="{lang editTip44}" name="editreason[]"/>{lang editTip44}</label>
	<label><input type="checkbox" value="{lang editTip45}" name="editreason[]"/>{lang editTip45}</label>
	<label><input type="checkbox" value="{lang editTip46}" name="editreason[]"/>{lang editTip46}</label>
	<label><input type="checkbox" value="{lang editTip47}" name="editreason[]"/>{lang editTip47}</label>
	<label><input type="checkbox" value="{lang editTip48}" name="editreason[]"/>{lang editTip48}</label>
	<label><input type="checkbox" value="{lang editTip49}" name="editreason[]"/>{lang editTip49}</label>
	<label><input type="checkbox" value="{lang editTip50}" name="editreason[]"/>{lang editTip50}</label>
	<br /><br />{lang editTip51}<br />
	<textarea rows="2" name="editreason[]" id="editreason" class="inp_txt"></textarea>
	</div>
</div>
<!--{/if}-->

<!--{if ($doc_verification_edit_code && ($page_action == 'edit'||$page_action == 'editsection' )) || (!empty($doc_verification_create_code) && $page_action == 'create')}-->
<div id="doc_verification_code" class="hd-box editor_left">
	<h2>{lang verifyCode}<span class="red">[{lang mustBeCompleted}]</span></h2>
	<div>
	<input name="code" type="text" class="inp_txt" size="10" maxlength="4"/>
	<span name="img" style="display:none"><img id="verifycode" src="./js/hdeditor/skins/spacer.gif"/> <a href="javascript:updateverifycode();">{lang codeNotClear}</a></span>
	<span name="tip"></span>
	</div>
</div>
<!--{/if}-->

<div class="pushbutton">
	<input name="publishsubmit" class="btn_inp blue" type="submit" value="{lang publish}" />
	<input type="button" class="btn_inp" value="{lang logout}" onclick="abort();"/>
</div>
</section>
</form>

<div id="editor_right" class="">
<div id="editor_mulu">
	<ul class="editor_mulu_nav"><li class="on" onclick="this.className='on';this.nextSibling.className='';document.getElementById('doc-catalog').style.display='block';document.getElementById('right-prompt').style.display='none';">词条目录</li><li onclick="this.className='on';this.previousSibling.className='';document.getElementById('doc-catalog').style.display='none';document.getElementById('right-prompt').style.display='block';" class="">自动保存</li></ul>
	<div id="doc-catalog" class="catalog" style="display: block;">
		<ul id="catagoryList">
			<li><a href="javascript:void(0)" catalogkey="1" class="bold" title="简介" alt="简介">简介</a></li>
		</ul>
        <br>
        <br>
	</div>
	<div id="right-prompt" class="right-prompt" style="display: none;">
		<ul>
		<!--{if $page_action != 'editsection'}-->
		<li><input name="autosave" type="checkbox" id="autosave" onclick="isAutoSave()" checked="checked"/>{lang auto}{lang save}</li>
		<!--{/if}-->
		<li id='AutoSaveStatus'></li>
		<li id="editor_tip"></li>
		<li class="help"><a href="http://service.baike.com/article-940349.html" target="_blank">{lang editorTip0}</a></li>
		</ul>
		<p><a href="{WIKI_URL}" target="_blank"><img src="style/default/logo.gif" width='168px' height='54px'/></a></p>
	</div>
</div>
</div>

<div style="display:none">
<form method="post" id="previewdocform" target="_blank" action="index.php?doc-edit-$doc['did']">
<textarea name="content"></textarea>
<input name="predoctitle" type="hidden" value="{$doc['title']}"/>
</form>
</div>
<style>
.jqe-plugin-HdImage .uploadBoxTop span.last_span {display:none;}
</style>
<script type="text/javascript">
<!--{if $filter_external }-->
var g_filterExternal = 1;
<!--{else}-->
var g_filterExternal = 0;
<!--{/if}-->
<!--{if ($doc_verification_edit_code && ($page_action == 'edit'||$page_action == 'editsection' )) || ($doc_verification_create_code && $page_action == 'create')}-->
var g_check_code = "1";
<!--{else}-->
var g_check_code = "0";
<!--{/if}-->
var g_page_action = "$page_action";
var g_logout_editor = "{url doc-unseteditlock-$doc['did']-$page_action}";
var g_docid = "$doc['did']";
var savetime={$savetime};
var g_content_md5='';

var g_img_big="$g_img_big";
var g_img_small="$g_img_small";
var jqe_static_url = './js/jqeditor';
</script>
<script type="text/javascript" src="./js/jqeditor/jqeditor-hdwiki-2.1.7.min.js"></script>
<script type="text/javascript" src="./js/jqeditor/hdwiki.js"></script>
<script type="text/javascript">
isAutoSave();
</script>
</body>
</html>
